package april.test_4_20;

import java.util.Scanner;

public class TestMain3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int tmp = 1000000;
        if (n > tmp) {
            int count = (int)((n / tmp )* ((n - 1)/(tmp/10)));
            System.out.print(count);
            count = ((n % tmp) *((n - 1) % tmp) + 1);
            System.out.println(count);
        } else {
            System.out.println(n*(n-1) + 1);
        }
    }
}
